package com.example.demo.base;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;

/**
 * 实体基础类
 */
@SuppressWarnings({ "serial", "rawtypes" })
public abstract class BaseEntity<T extends Model> extends Model<T> {
    /**
     * 统一配置的主键，采用统一序列赋值
     */
    @TableId(value = "ID", type = IdType.ID_WORKER)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    protected Long pkVal() {
        return this.id;
    }
}
